<template>
  <div>
    <div @click="clickWeb" class="vue-flow-model">
      <n-icon size="30" color="#18A058">
        <ApplicationWeb/>
      </n-icon>
<!--      <Handle id="WebUrl-export" type="source" :position="Position.Right"-->
<!--              :is-valid-connection="props.isValidTargetPos"/>-->
    </div>
    <span>网页URL</span>
<!--    <flow-popup-window-->
<!--        :show="popup.show"-->
<!--        :on-click-outside="popup.clickPopupOutside"-->
<!--        :x="popup.x"-->
<!--        :y="popup.y"-->
<!--    >-->
<!--      <n-card title="网页URL">-->
<!--        <p>URL地址</p>-->
<!--          <a href="gege://">打开EasySpider</a>-->
<!--        <n-select-->
<!--            placeholder="URL地址"-->
<!--            v-model:value="value"-->
<!--            :options="props.data.data"-->
<!--            label-field="name"-->
<!--            value-field="id"-->
<!--            @update:value="popup.reopen"-->
<!--        />-->
<!--      </n-card>-->
<!--    </flow-popup-window>-->
  </div>
</template>

<script setup>
import {ApplicationWeb} from "@vicons/carbon"
// import {Handle, Position} from "@vue-flow/core";
// import FlowPopupWindow from "@/components/VueFlowModel/vueFlowPopupWindow/FlowPopupWindow.vue";
// import workApi from "@/http/workApi";
// import {useRoute} from "vue-router";

//
// const props = defineProps(['isValidTargetPos', 'isValidSourcePos', 'data'])
// const route = useRoute()
//
// // 点击弹窗
// const popup = reactive({
//   show: false,
//   x: null,
//   y: null,
//   clickPopupOutside: () => {
//     popup.closedPopup()
//   },
//   openPopup: (e) => {
//     popup.x = e.x
//     popup.y = e.y
//     popup.show = true
//   },
//   closedPopup: () => {
//     popup.show = false
//   },
//   reopen: () => {
//     popup.show = true
//   }
// })
//
// const value = ref(null)
// workApi.get("perform_tasks/get_web", {
//   params: {
//     task_id: route.query.taskId
//   }
// }).then(r => {
//   props.data.data = r.data
// })
const clickWeb = () => {
  let expandScreenUrl = 'gege://'
  try {
    window.protocolCheck(expandScreenUrl, function () {
      window.$dialog.info({
        title: '监测到未下载网页采集程序',
        content: '是否进行下载？',
        positiveText: '下载',
        negativeText: '算了吧',
        onPositiveClick: () => {
          window.open("/static/download/app/EasySpider_windows_x64.zip")
        },
        onNegativeClick: () => {
          window.$message.info('说不定有病毒呢是吧? 让我先确定安不安全')
        }
      })
    })
  } catch (e) {
    // 捕捉异常
    console.log(e)
  }
}
</script>

<style scoped lang="less">
.n-card {
  width: 400px;

}
</style>